﻿package com.wxsoft.business.sale.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.wxsoft.business.model.easyui.PageHelper;

import com.wxsoft.business.sale.dao.ISlOrderDao;
import com.wxsoft.business.sale.service.ISlOrderService;
import com.wxsoft.business.sale.pojo.SlOrder;

@Service("slOrderService")
public class SlOrderServiceImpl implements ISlOrderService  {
	@Resource
	private ISlOrderDao dao;
	
	
	public long findCount(SlOrder slOrder) {
		return dao.findCount(slOrder);
	}
	
	public List<SlOrder> findAll(PageHelper page,SlOrder slOrder) {
        List<SlOrder> r = dao.findAll(page,slOrder);
		return r;
	}
	public List<SlOrder> getBy(SlOrder slOrder) {
        List<SlOrder> r = dao.getBy(slOrder);
		return r;
	}
	@Transactional
	public String add(SlOrder slOrder) {
		int r = this.dao.insert(slOrder);
		if(r==1){
			return "操作成功!";
		}
		return "操作失败!";
	}
	@Transactional
	public String modify(SlOrder slOrder) {
		int r = this.dao.modify(slOrder);
		if(r==1){
			return "操作成功!";
		}
		return "操作失败!";
	}
	@Transactional
	public String delete(SlOrder slOrder) {
		int r = this.dao.delete(slOrder);
		if(r==1){
			return "操作成功!";
		}
		return "操作失败!";
	}
	
}
